package org.ztr.saa13toolcalling.controller;

import com.alibaba.cloud.ai.dashscope.api.DashScopeApi;
import jakarta.annotation.Resource;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/10/25 19:35
 * @Description: 无工具调用
 * @Version: 1.0
 */

@RestController
public class NoToolCallingController
{
    @Resource
    private ChatModel chatModel;

    /**
     * http://localhost:8013/notoolcall/chat
     * @param msg
     * @return
     */
    @GetMapping("/notoolcall/chat")
    public Flux<String> chat(@RequestParam(name = "msg",defaultValue = "你是谁现在几点") String msg)
    {
        return chatModel.stream(msg);
    }
}
